/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.app.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "series")
public class Series implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    
    @Column(name = "id")
    private Integer id;
    
    @Basic(optional = false)
    @Column(name = "value")
    private String value;
    
    @Basic(optional = false)
    @Column(name = "flag")
    private int flag;
    
    /*
    @OneToMany(cascade = CascadeType.REFRESH, mappedBy = "seriesId", fetch = FetchType.LAZY)
    private Collection<Product> productBySeriesIdList;
    
    @OneToMany(cascade = CascadeType.REFRESH, mappedBy = "seriesNameId", fetch = FetchType.LAZY)
    private Collection<Product> productBySeriesNameIdList;
    */


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    /*
    public Collection<Product> getProductBySeriesIdList() {
        return productBySeriesIdList;
    }

    public void setProductBySeriesIdList(Collection<Product> productBySeriesIdList) {
        this.productBySeriesIdList = productBySeriesIdList;
    }

    public Collection<Product> getProductBySeriesNameIdList() {
        return productBySeriesNameIdList;
    }

    public void setProductBySeriesNameIdList(Collection<Product> productBySeriesNameIdList) {
        this.productBySeriesNameIdList = productBySeriesNameIdList;
    }
     */
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Series)) {
            return false;
        }
        Series other = (Series) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

}
